Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31

Thread: Understanding the Reborn Intermission Event

  1. #11

    Default

    Quote Originally Posted by DoubleKill View Post
    Putting that code after waittill spawn may could fix?
    Nope. At the moment, I am completely baffled as to why this script will not run more than once.... even when I change the script to run in a while(1) loop.

    I guess I'll be hunting this down by creating a basic mod with just the dmprecache and the script. Really confused at the moment. I thought I understood how all of this worked, but evidently not. But then again, it's just this one script giving me problems. Engine seems fine. Not getting any syntax errors or complaints from it.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  2. #12
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Ok , theres still something not right about the intermission event with an objective type , i just tested it with a basic thing , ill post the script then the results

    Code:
    main:
    
    local.intermission = registerev "intermission" test.scr::intermission
    
    while(1)
    {
    level.test = getcvar("intermission")
    
    iprintlnbold_noloc (level.test)
    
    wait 10
    
    }
    
    
    end
    
    intermission local.type:
    
    if(local.type == 0)
    {
    setcvar "intermission" "player(0)"
    }
    if(local.type == 1)
    {
    setcvar "intermission" "change(1)"
    }
    if(local.type == 2)
    {
    setcvar "intermission" "restart(2)"
    }
    
    end
    ok now results are strange

    On map change , cvar change(1) is set ,( both with rcon map and fraglimit reached) which is good and right A+

    On Map restart via rcon , cvar is set to restart(2) all good right??

    But on round end on an objective game , the cvar is set to restart(2) which is very wrong lol shouldn't it be player intermission?

    So then i removed the setcvar restart(2) and played again , and then the cvar wouldnt set to anything on player intermission at all (0) so i dont think it actually does anything on roundend only map ends ,

    Any ideas how how to fix it lol

    Maybe Own-Em-All if you just use the restart one (2) as the player intermission one instead lol it seems (0) doesnt do anything on round end it restarts itself every round , so maybe try that in the script ,

    if(local.type == 2 ) etc etc
    Last edited by Purple Elephant1au; April 25th, 2013 at 03:37 AM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #13

    Default

    Thanks Purple. So you're saying you got the script to work by setting the intermission type to 2?

    I was going to play around with it, and was trying to do so, but I ran into my script not even being executed more than once. As soon as I have time to figure out why, I'll definitely give this a try.

    Thanks for the help!
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  4. #14
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Hi

    Ok i had another look at the script and actually tried running it.

    So you want to to swap them at map change right?
    so swap = 1 at map change so it would be local.type 1.
    i Dont see why you need to use the player intermission one to set it back to 0 , because you have the line in the script to set it back to 0

    Code:
    if(getcvar swapped == "1") {
                setcvar swap "0"
                setcvar swapped "0"
    ?? ???

    Anyway i got it to work and your gonna kick yourself when you see why it wasnt working ,

    I changed the intermission event to this

    Code:
    intermission local.type:
    
        if(local.type == 1)
        {
            setcvar swap "1"
        }
            
    end
    And all i did after that was change the wait 5 to wait 0.5 , in
    Code:
    // Register events
            if(level.elgboton != 1){
              
              // Unregister events just to be on the safe side:
              
              // local.unreg2 = unregisterev "intermission"
              // local.unreg3 = unregisterev "connected"
              
              // println local.unreg2
              // println local.unreg3
              
              wait 0.5   // Was wait 5 , you could change it around till you find a higher one to work but that one did
    
              local.connectme = registerev "connected" testcvar.scr::connected
              local.intermission = registerev "intermission" testcvar.scr::intermission
            }
    The reason was because the players would connect just before the connection event would be registered , too long of a wait. so the connection event wouldnt start running until the second round in which people would then swap teams. So when i was testing i just added some iprints with a wait 10 iin the connection event and saw it wasnt working on first round of the new map . So i removed the wait and it started working straight away . so i just added the wait back and set to to 0.5 to see if you could make it wait abit and still work . Lol Try those changes and see if it works if elgbot is on , i dont use it so i didnt test with it on.

    And i dont see the need to have the player intermission set to back to 0 , since it does it the start of the next round anyway before the connection event is called, i tested it with
    Code:
    intermission local.type:
    
        if(local.type == 1)
        {
            setcvar swap "1"
        }
        else
        {
        setcvar swap "0"
        }
            
    end
    And it did the same thing as without having it set back to 0 by the intermission and just the first part of the script. but each to their own you can use either way.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #15

    Default

    Purple,

    Can you post your full script here? I changed it like you did, but it doesn't work for me. It could be related to my dmprecache problem though.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  6. #16
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Hi

    I just redid it again making the changes i did last time and it still works for me.

    Here:
    Code:
    main:
        if(int(getcvar(inscrim)) == 1){
            // If inscrim is not set DO NOTHING
            teamswitchdelay .2
        
            if(level.swapLoaded)
                end
        
            level.swapLoaded = 1
            
            //Check if players were swapped last round, if so, reset the cvars
            if(getcvar swapped == "1") {
                setcvar swap "0"
                setcvar swapped "0"
            }
                
            // Register events
            if(level.elgboton != 1){
              
              // Unregister events just to be on the safe side:
              
              // local.unreg2 = unregisterev "intermission"
              // local.unreg3 = unregisterev "connected"
              
              // println local.unreg2
              // println local.unreg3
              
              wait 0.5
              local.connectme = registerev "connected" teamswap/swap.scr::connected
              local.intermission = registerev "intermission" teamswap/swap.scr::intermission
            }
        }
    
        
    end
    
    connected local.player:
    
        if(getcvar swap == "1" && int(getcvar(inscrim)) == 1) {    
            if(local.player.dmteam == "axis") {
                setcvar swapped "1"  //set a cvar so that we don't swap again next round.
                local.player join_team allies
            }
            else {
                if(local.player.dmteam == "allies") {
                    setcvar swapped "1" //set a cvar so that we don't swap again next round.
                    local.player join_team axis    
                }
            }
        }    
        
    end
    
    
    
    intermission local.type:
    
        if(local.type == 1)
        {
            setcvar swap "1"
        }
            
    end
    Also note, that when your testing it , Change map , play a round , then change map ,

    If you keep just changing maps without playing a round to give the cvars the chance to reset , it will only swap teams every second map change ,

    But thats only for testing because when its on server , its going to be more then 1 round each map change.

    And Yea the dmprecache is a weird problem , also on that ,
    theres no point having a level waittill prespawn in any script that it exec from dmprecache.
    Because dmprecache is already exec after level waittill prespawn in the map.scr,
    so thats why it came up as an error in the log in elgbot.scr before on your other post

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  7. #17

    Default

    Purple, your script is still not correct. Now that I can finally debug again, here's the real scoop on how the intermission event works:

    When the fraglimit (ffa) or roundlimit (obj / dm) has been reached, the intermission local.type variable is set to 0. However, the server may or may not call another map depending on the config after this intermission. If the server.cfg is setup to run a different map, local.type will be set to 1 right before the map is called. If the server is setup to play the same map again and again (only one map in rotation), then a restart is called which again calls intermission and local.type is set to 2 before the first round of the same map begins. Rcon restart will also result in local.type being equal to 2.

    So the real documentation should read:

    Code:
    /*
           Intermission Event (Runs after fraglimit or roundlimit has been reached, when a new map is called either by a config or rcon, and when a map restarts in between rounds or rcon restart command is issued):
       
            // There are many types of intermission which occur
            // When the intermission event is threaded, the type of intermission depends on what is going on in the server.  
           // Depending on the circumstances, the type of intermission is stored in a variable called local.type which can be set to integer values of 0, 1, and 2 ONLY
    
    	local.type - type of server intermission
    
            // local.type values and what they each mean
    
    	0 = Player intermission screen (happens when map's fraglimit / roundlimit has been reached)
    	1 = Map change (happens after using the following rcon commands: map and gamemap) && (happens when the server is switching to a DIFFERENT MAP)
    	2 = Map restart (happens after using the rcon restart command from console)  && (happens in between rounds) && (happens during short intermissions when a round [NOT THE FINAL ROUND BEFORE FRAGLIMIT] is over and player scores are shown real quick for the round) && (happens directly after the final player intermission screen [when local.type is set to 0] IF AND ONLY IF THE SAME MAP IS GOING TO BE LOADED or REPLAYED DUE TO ONLY ONE MAP BEING IN THE MAP LIST [ example: sv_maplist "obj/obj_team2" ]
    */
    I hope that makes sense. An example of how to use the intermission event properly is shown in the below code snippet.

    The script should look like:

    Code:
    main:
        
        // Set debug mode
        local.debug = 0;
        
        local.inScrim = int(getcvar(inscrim))
        
        if(local.debug == 1){
          println "Debug CVAR Print"
          println local.inScrim
          println level.elgboton
        } 
        
        if(local.inScrim == 1){
              // Set teamswitch delay
              teamswitchdelay .1
              
    
              if(int(getcvar("elgbot")) == 0){
                
                // Unregister events
                if(level.unregSwap == NIL || level.unregSwap == 0){
                  level.unregSwap = 1;
                  if(local.debug == 1){
                    local.unreg2 = unregisterev "intermission"
                    local.unreg3 = unregisterev "connected"
                    
                    // Print out the results              
                    println "Event Un-Registration Debug Print"
                    println local.unreg2
                    println local.unreg3
                  }
                }
                
                // Register events
      
                local.connectme = registerev "connected" teamswap/swap.scr::connected
                local.intermission = registerev "intermission" teamswap/swap.scr::intermission
                
                // Print out results
                if(local.debug == 1){
                  println "Event Registration Debug Print"
                  println local.connectme
                  println local.intermission
                }
              }
        }
        //Check if players were swapped last round, if so, reset the cvars
        if(getcvar swapped == "1") {
        
            setcvar swap "0"
            setcvar swapped "0"
        }
    end
    
    connected local.player:
    
        if(getcvar swap){
          println "In connected event and swap is:"
          println (getcvar swap)
        }
        
        if(getcvar swap == "1" && int(getcvar(inscrim)) == 1) {    
            if(local.player.dmteam == "axis") {
                setcvar swapped "1"  //set a cvar so that we don't swap again next round.
                local.player join_team allies
            }
            else {
                if(local.player.dmteam == "allies") {
                    setcvar swapped "1" //set a cvar so that we don't swap again next round.
                    local.player join_team axis    
                }
            }
        }    
    end
    
    intermission local.type:
        println local.type
        
        if(local.type == 0){
            setcvar swap "1"
            println "intermission event hit... setting swap cvar up"
        }else if(local.type == 1){
            setcvar swap "1"
            println "intermission event hit... setting swap cvar up"
        }   
    end
    The reason why it didn't work before is because in the log:

    Code:
    intermission local.type = 0
    intermission event hit... setting swap cvar up
    intermission local.type = 2
    ...
    first round of same map begins
    connected event is called but swap is set to 0 instead of 1 because intermission was called twice with the last time having local.type set to 2 where we reset swap to 0 in the original script.
    I tested it, and it's working perfectly now!
    Last edited by own3mall; May 21st, 2013 at 07:50 PM.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  8. #18
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Strange it worked for me , but i didnt go through multiple maps when testing which was probably the reason why lol

    Glad you got it working , its a handy script to have, i use a spawn swap mod instead of a team swap mod , because they were always buggy for me , before this one was out anyway.

    and i saw the reason why your dmprecache wasnt working lol it happens to me sometimes aswell.
    Worse thing i did was forgetting where i registered an event. Had to look over the different scripts ( specially when testing multiple ) to find which one had the event i needed lol But i decided it was time to organize so i made an eventhandler script so i dont make the same mistake lol

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  9. #19
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Does it really? I thought the map would be reloaded, not restarted.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  10. #20

    Default

    Quote Originally Posted by Sor View Post
    Does it really? I thought the map would be reloaded, not restarted.
    That's what I had assumed too. But, when I tested and printed out the local.type variable, it was 0, then 2, then map restarted since the map was already loaded.

    @purple, I changed this and modified the script for one map rotation. In scrim, you play two sets of rounds. After the first set, intermission is reached due to fraglimit. It's set to 0 at this point, but then 2 is called because the map restarts for the second set of rounds. This is when teams should be swapped.

    Now, I haven't yet tested this on Linux, but I believe it will behave the same way since the original script stopped working a while ago.

    I think something changed in reborn, as I don't think the restart occurred in the past. At that point, the original script was working. I tested this in Reborn RC 3.5.1 v 1.116 (latest test version) in Windows. Now it works perfectly all the time.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •